<template>
    <p>count值为：{{ count }}</p>
    <button @click="CountAdd">+n</button>
</template>

<script setup>
import { ref } from 'vue';

const emit = defineEmits(['updateCount'])
const count = ref(1)
const CountAdd = () =>{
    count.value++
    emit('updateCount',2)
}
</script>

<style scoped>

</style>